<html>
<head>
<#include "../common/header.ftl">
    <title>商品列表</title>
</head>
<body>
<div id="wrapper" class="toggled">
<#-- 边栏sidebar start -->
<#include "../common/nav.ftl">
<#-- 边栏sidebar end -->

<#-- 主要内容content start -->
    <div id="page-content-wrapper">
        <div class="container-fluid">
            <div class="row clearfix">
                <div class="col-md-12 column">
                    <table class="table table-hover table-bordered table-condensed">
                        <thead>
                        <tr>
                            <th>商品id</th>
                            <th>名称</th>
                            <th>图片</th>
                            <th>单价</th>
                            <th>库存</th>
                            <th>描述</th>
                            <th>类目</th>
                            <th>创建时间</th>
                            <th>修改时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <#list productPage.content as product>
                        <tr>
                            <td> ${product.productId}</td>
                            <td> ${product.productName}</td>
                            <td><img src="${product.productIcon}" alt="${product.productName}" width="50px"
                                     height="50px"></td>
                            <td> ${product.productPrice}</td>
                            <td> ${product.productStock}</td>
                            <td> ${product.productDescription}</td>
                            <td> ${product.categoryType}</td>
                            <td> ${product.createTime}</td>
                            <td> ${product.updateTime}</td>
                            <td>
                                <a type="button" class="btn btn-default btn-primary"
                                   href="/sell/seller/product/index?productId=${product.productId}">修改</a>

                                <#if product.productStatus = 0>
                                    <a type="button" class="btn btn-default btn-success"
                                       href="/sell/seller/product/off_sale?productId=${product.productId}">下架</a>
                                <#else>
                                    <a type="button" class="btn btn-default btn-danger"
                                       href="/sell/seller/product/on_sale?productId=${product.productId}">上架</a>
                                </#if>
                            </td>
                        </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>

                <!-- 分页组件 -->
                <div class="col-md-12 column">
                    <ul class="pagination pull-right">
                    <#if currentPage lte 1>
                        <li class="disabled"><a href="#">上一页</a></li>
                    <#else >
                        <li><a href="/sell/seller/order/list?page=${currentPage - 1}&size=${size}">上一页</a></li>
                    </#if>
                    <#list 1..productPage.getTotalPages() as index>
                        <#if currentPage == index>
                            <li class="disabled"><a href="#">${index}</a></li>
                        <#else>
                            <li><a href="/sell/seller/order/list?page=${index}&size=${size}">${index}</a></li>
                        </#if>
                    </#list>
                    <#if currentPage gte productPage.getTotalPages()>
                        <li class="disabled"><a href="#">下一页</a></li>
                    <#else >
                        <li><a href="/sell/seller/order/list?page=${currentPage + 1}&size=${size}">下一页</a></li>
                    </#if>
                    </ul>
                </div>
            </div>
        </div>
    </div>
<#-- 主要内容content end -->
</div>

</body>
</html>
